﻿using System.ComponentModel.Design;
using Microsoft.Practices.Prism.Events;

namespace UXTaskManager.Service
{
    public class ServiceLocator : ServiceContainer
    {
        #region Singleton

        private static ServiceLocator _instance;
        public static ServiceLocator Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new ServiceLocator();
                return _instance;
            }
        }

        #endregion

        public ServiceLocator()
        {
            LoadAllServices();
        }

        public void LoadAllServices()
        {
            AddService(typeof(IEventAggregator), new EventAggregator());
        }
    }
}
